<?PHP use_javascript("/js/i18n/grid.locale-cn.js") ?>
<?PHP use_javascript("/js/jquery.jqGrid.min.js") ?>
<?PHP use_stylesheet("/css/ui.jqgrid.css") ?>
<?PHP include_partial("rightnow") ?>



<script type="text/javascript">
    $(document).ready(function(){

        $("#table_cust_list").jqGrid({
            url: "<?PHP echo url_for("cust/getCustList.json") ?>",
            datatype: "json",
            width: 700,
            colNames:["Id","客户编号","客户名称","完整客户名称","客户类别","联系地址","其它联系地址","邮政编码","电话号码","联系人","传真","备注","录入人员","录入日期","最后维护日期"],
            colModel:[
                {name: "id", hidden: true},
                {name: "cust_no"},
                {name: "cust_name"},
                {name: "cust_fname", hidden: true},
                {name: "cust_type" },
                {name: "cust_addr", hidden: true },
                {name: "cust_addr1", hidden: true },
                {name: "cust_zip", hidden: true },
                {name: "cust_tel", hidden: true },
                {name: "cust_contact", hidden: true },
                {name: "cust_fax", hidden: true },
                {name: "cust_memo", hidden: true },
                {name: "cust_opr"},
                {name: "created_at"},
                {name: "updated_at"},
            ],
            rowNum: 20,
            rowList: [10,20,30],
            pager: "#pager_cust_list",
            sortname: 'id',
            viewrecords: true,
            sortorder: "desc",
            caption: "&nbsp;"
        });
        $("#table_cust_list").jqGrid('navGrid','#pager_cust_list',{edit:false, add:false, del:false })
            .jqGrid('navButtonAdd',"#pager_cust_list",{
                caption:"显示/隐藏列",
                id:"show_hide_column",
                onClickButton: function() {
                    $('#table_cust_list').setColumns()
                }
        });


    });

</script>

<div id="box">
    <h3>客户资料浏览</h3>
    <table id="table_cust_list" width="100%" align="center">
    </table>
    <div id="pager_cust_list"></div>
</div>
<br />
